package com.mdsoft.dao.context;

import com.mdsoft.context.Context;
import com.mdsoft.dao.GroupCountDao;

public class ContextGroupCountDao implements GroupCountDao {

	@Override
	public void setGroupCount(int groupCount) {
		Context.getInstance().put(Context.GROUP_COUNT, groupCount);
	}

	@Override
	public int getGroupCount() {
		Object object = Context.getInstance().get(Context.GROUP_COUNT);
		if (object == null) {
			setGroupCount(0);
			return 0;
		}
		return (Integer) object;
	}

}
